//
//  rzxqTableViewCell.m
//  hainingOASystem
//
//  Created by michael on 2017/12/2.
//  Copyright © 2017年 czd. All rights reserved.
//

#import "rzxqTableViewCell.h"

@implementation rzxqTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {

_label1 = [[UILabel alloc]init];
      _label1.frame = CGRectZero;
      _label1.numberOfLines = 0;
       [_label1 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label1];
    
    
    
            _label2 = [[UILabel alloc]init];
      _label2.frame = CGRectZero;
      _label2.textAlignment = NSTextAlignmentRight;
      _label2.numberOfLines = 0;
       [_label2 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2];
}

return self;

}
- (void)layoutSubviews{
[super layoutSubviews];
int intString = [_number intValue];
_label1.text = _array[intString];
_label1.frame =CGRectMake(10, 10, 100, 40);
_label2.frame =CGRectMake(_label1.right, 10, KScreenWidth-20-100, 40);
if ([_label1.text isEqualToString:@"申请订单:"]) {
if (![_dic[@"f_num"] isEqual:[NSNull null]]) {
        _label2.text =_dic[@"f_num"] ;
}else{
        _label2.text =@"" ;
}

}else if([_label1.text isEqualToString:@"申请人/机构:"]){
if (![_dic[@"uname"] isEqual:[NSNull null]]||![_dic[@"realname"] isEqual:[NSNull null]]) {
_label2.text = [NSString stringWithFormat:@"%@/%@",_dic[@"uname"],_dic[@"realname"]];
}else{
        _label2.text =@"" ;
}
}else if([_label1.text isEqualToString:@"申请时间:"]){
if (![_dic[@"createTime"] isEqual:[NSNull null]]) {

    _label2.text =_dic[@"createTime"] ;}
    else{
        _label2.text =@"" ;
}
}
else if([_label1.text isEqualToString:@"融资用途:"]){

if([[NSString stringWithFormat:@"%@",_dic[@"f_use"]]isEqualToString:@"1"]){
    _label2.text =@"流动资金贷款" ;
    }else if([[NSString stringWithFormat:@"%@",_dic[@"f_use"]]isEqualToString:@"2"]){
        _label2.text =@"项目贷款" ;
        
    }else
        {
        
           _label2.text =@"";
        }
   
}
else if ([_label1.text isEqualToString:@"融资金额:"]) {
if (![_dic[@"amount"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@万元",_dic[@"amount"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"项目简要说明:"]) {
if (![_dic[@"b_description"] isEqual:[NSNull null]]) {
      CGFloat titleSize = [OAToolBox sizebyText:_dic[@"b_description"] font:13 minsWidth:120];
_label2.frame =CGRectMake(_label1.right, 10, KScreenWidth-20-100, titleSize);
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"b_description"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"融资年限:"]) {
if (![_dic[@"limit"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@年",_dic[@"limit"]] ;
} else{
        _label2.text =@"" ;
}
}

else if ([_label1.text isEqualToString:@"可接受利率:"]) {
if (![_dic[@"rate"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"rate"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"合作机构:"]) {
if (![_dic[@"institutionName"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"institutionName"]] ;
} else{
        _label2.text =@"" ;
}
}

else if ([_label1.text isEqualToString:@"融资方式:"]) {
if (![_dic[@"way"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"way"]] ;
} else{
        _label2.text =@"" ;
}
}

else if ([_label1.text isEqualToString:@"质押或抵押物说明:"]) {
if (![_dic[@"m_description"] isEqual:[NSNull null]]) {
      CGFloat titleSize = [OAToolBox sizebyText:_dic[@"m_description"] font:13 minsWidth:120];
_label2.frame =CGRectMake(_label1.right, 10, KScreenWidth-20-100, titleSize);
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"m_description"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"联系人:"]) {
if (![_dic[@"linkman"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"linkman"]] ;
}
else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"职务:"]) {
if (![_dic[@"position"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"position"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"固定电话:"]) {
if (![_dic[@"telephone"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"telephone"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"联系人手机:"]) {
if (![_dic[@"phone"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"phone"]] ;
} else{
        _label2.text =@"" ;
}
}

else if ([_label1.text isEqualToString:@"补充说明:"]) {
if (![_dic[@"s_description"] isEqual:[NSNull null]]) {
   CGFloat titleSize = [OAToolBox sizebyText:_dic[@"s_description"] font:13 minsWidth:120];
_label2.frame =CGRectMake(_label1.right, 10, KScreenWidth-20-100, titleSize);
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"s_description"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"回复意见:"]) {
if (![_dic[@"type"] isEqual:[NSNull null]]) {
if([[NSString stringWithFormat:@"%@",_dic[@"type"]]isEqualToString:@"0"]){
        _label2.text =@"不同意" ;
}else{
        _label2.text =@"同意" ;

}
}
else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"可提供融资金额(万):"]) {
if (![_dic[@"amount"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@万",_dic[@"amount"]] ;
}
}
else if ([_label1.text isEqualToString:@"回复机构:"]) {
if (![_dic[@"name"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"name"]] ;
} else{
        _label2.text =@"" ;
}
}

else if ([_label1.text isEqualToString:@"回复时间:"]) {
if (![_dic[@"datetime"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"datetime"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"回复内容:"]) {
if (![_dic[@"content"] isEqual:[NSNull null]]) {
   CGFloat titleSize = [OAToolBox sizebyText:_dic[@"content"] font:13 minsWidth:120];
_label2.frame =CGRectMake(_label1.right, 10, KScreenWidth-20-100, titleSize);
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"content"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"评论时间:"]) {
if (![_dic[@"datetime"] isEqual:[NSNull null]]) {
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"datetime"]] ;
} else{
        _label2.text =@"" ;
}
}
else if ([_label1.text isEqualToString:@"评论内容:"]) {
if (![_dic[@"content"] isEqual:[NSNull null]]) {
   CGFloat titleSize = [OAToolBox sizebyText:_dic[@"content"] font:13 minsWidth:120];
_label2.frame =CGRectMake(_label1.right, 10, KScreenWidth-20-100, titleSize);
        _label2.text =[NSString stringWithFormat:@"%@",_dic[@"content"]] ;
} else{
        _label2.text =@"" ;
}
}


}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
